package com.bwie.controller;

import com.bwie.service.TbUserService;
import com.bwie.utils.R;
import com.bwie.vo.UserLoginVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.naming.Name;

@RestController
@RequestMapping("/user/index")
public class IndexController {

    @Autowired
    TbUserService userService;

    @ApiOperation("用户登录")
    @PostMapping("/userLogin")
    public R userLogin(@RequestBody UserLoginVo userLoginVo){
        return userService.userLogin(userLoginVo);
    }

    @ApiOperation("根据用户名来查询用户")
    @PostMapping("/getUserListByname/{Name}")
    public R getUserListByname(@PathVariable(name = "Name")String Name){
        return userService.getUserListByname(Name);
    }
}
